<extend name="base/Base" />
<block name="Style">
<!-- FooTable Plugin CSS -->
		<link rel="stylesheet" type="text/css" href="__ABSOLUTEADMIN__/vendor/plugins/footable/css/footable.core.min.css">
		<!-- Admin Forms CSS -->
		<link rel="stylesheet" type="text/css" href="__ABSOLUTEADMIN__/assets/admin-tools/admin-forms/css/admin-forms.css">
	
</block>
<block name="Topbar">
   <header id="topbar" class="ph10">
        <div class="topbar-left">
          <ul class="nav nav-list nav-list-topbar pull-left">
            
            <li  class="active">
              <a  href="__APP__/Mall/MyExpress/Manage.html"   >自有物流</a>
            </li>
			 <li  >
              <a  href="__APP__/Mall/MyExpressNode/Manage.html"   >物流节点</a>
            </li>
			 <li  >
              <a  href="__APP__/Mall/MyExpressAddress/Manage.html" >自提点</a>
            </li>
			
           
          </ul>
        </div>
		<div class="topbar-right hidden-xs hidden-sm">
		 <a href="#"  onclick="selectAll()" class="btn btn-default btn-sm fw600 ml10">
            <span class="fa fa-star pr5"></span>全选</a>
			 <a href="#"   onclick="unSelect()"  class="btn btn-default btn-sm fw600 ml10">
            <span class="fa fa-star-o pr5"></span>不选</a>
			 <a href="#"    onclick="reverse()"class="btn btn-default btn-sm fw600 ml10">
            <span class="fa fa-star-half-o pr5"></span>反选</a>
			  
			  <a href="#" onclick="status(0)" class="btn btn-default btn-sm fw600 ml10">
				<span class="fa fa-fighter-jet pr5"></span>变更</a>
				<a href="#" onclick="deletestatus(0)" class="btn btn-default btn-sm fw600 ml10">
				<span class="fa fa-times-circle-o pr5"></span>删除</a>
			  
			
			
			 
						  
          
        </div>
	</header>
	 <header id="topbar" class="ph10">
        <div class="topbar-left">
          <ul class="nav nav-list nav-list-topbar pull-left">
			<volist name="nodes" id="nodes">
			<li   {$nodes.active} >
              <a  href="__APP__/Mall/OrderNode/Manage/id/{$nodes.id}.html"   >{$nodes.name}</a>
            </li>
			</volist>	
           
          </ul>
        </div>
		
	</header>
	
	<div class="modal fade" id="usermyModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
									  <div class="modal-dialog" role="document">
										<div class="modal-content">
										  <div class="modal-header">
											<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
											<h4 class="modal-title" id="myModalLabel">关系管理</h4>
										  </div>
										  <div class="modal-body">
											<div class="form-group">
												<label for="exampleInputEmail1">请输入用户UID</label>
												<input type="text" name="r_uid" id="r_uid" class="form-control"  placeholder="请输入用户UID">
											  </div>
											  
										
											<div class="form-group">
												<label for="exampleInputEmail1">请输入操作类型</label>
												<br>
												<label class="radio-inline">
												  <input type="radio" checked name="r_type" id="r_type" value="1"> 增加关联
												</label>
												<label class="radio-inline">
												  <input type="radio" name="r_type" id="r_type" value="2"> 删除关联
												</label>
												
												
											  </div>
											
											  
											
											
														
														
														
													
												
																
						
										  </div>
										  <div class="modal-footer">
											<button type="button" class="btn btn-default" data-dismiss="modal">关闭订单</button>
											<a href="#" class="btn btn-primary" onclick="relevance()" >确认操作</a>
															<script>
						
							
							function relevance(){  
								var uid = $("#r_uid").val();
								var group = $("#r_group").val();
								var type = $("input[name='r_type']:checked").val();;
							
								if(uid==''){
								
									layer.msg('请输入用户UID');
								
								}else{
								
									
									$.ajax({
										type:'POST',
										url:"__APP__/Admin/User/Relevance.html",
										data:{
											"uid": uid,
											"type": type,
											"group": group,
										
										},
										success:function(data){			
											var info = eval(data)
											if (info.errcode == 0) {
											
												layer.msg(info.errmsg);
												setTimeout(window.location.reload(),3000);
												
											}else{
												layer.msg(info.errmsg);
											}
										},
								
									});	
								
								}
								
								
								 
							}  
							</script>
										  </div>
										</div>
									  </div>
									</div>
	
				
</block>
<block name="Content">
	
	 <script type="text/javascript">
    // Firefox, Google Chrome, Opera, Safari, Internet Explorer from version 9
        function OnInput (event) {
            var code = event.target.value;
			
			if(strlen(code)==14){
				
				$.ajax({
					type:'POST',
					url:"__APP__/Mall/OrderNode/Change.html",
					data:{
						
						"order_id": code,
						"now_status": {$now_status},
					
						
						
					},
					success:function(data){								
						if (data == 1) {
							//alert('登录成功');
							window.location.reload();
							//self.location='__APP__/Simian/Home/Index/Details.html';
						}else{
							window.location.reload();
							//alert(data);
						}
						
					},
					error:function(){
						window.location.reload();
						//alert('未知错误');
					}
				
				});	
					
			}
			
        }
    // Internet Explorer
        function OnPropChanged (event) {
            if (event.propertyName.toLowerCase () == "value") {
                alert ("The new content: " + event.srcElement.value);
            }
        }
		function strlen(str){
			var len = 0;
			for (var i=0; i<str.length; i++) { 
			 var c = str.charCodeAt(i); 
			//单字节加1 
			 if ((c >= 0x0001 && c <= 0x007e) || (0xff60<=c && c<=0xff9f)) { 
			   len++; 
			 } 
			 else { 
			  len+=2; 
			 } 
			} 
			return len;
		}
		
		window.onload = function()
		{
			document.getElementById("code").focus();
		}

    </script>
	<div class="container-fluid">
	<div class="row">
	<form>
  <div class="form-group">
    <label for="exampleInputEmail1">请输入商品单号（也可使用扫码抢，注意两次使用时间间隔尽量超过3秒。）</label>
    <input type="text" class="form-control" id="code" oninput="OnInput (event)" name="code" id="exampleInputEmail1" placeholder="请输入商品单号">
  </div>


 <!--  <button type="submit" class="btn btn-default" style="width:100%;">提交</button> -->
</form>
	</div>	
	</div>	
	
	 <!-- begin: .tray-center -->
        <div class="row">

        <!-- Panel with: Data Filter -->
          <div class="col-md-12" id="spy2" >
            <div class="panel-heading">
              <span class="panel-title">
                <span class="fa fa-search"></span>扫码确认</span>
               <div class="pull-right">
			  		
              </div> 
            </div>
            <div class="panel-menu">
              <input id="fooFilter" type="text" class="form-control" placeholder="请输入搜索的关键字">
            </div>
            <div class="panel-body pn">
               <table class="table footable"  data-filter="#fooFilter"  data-page-navigation=".pagination" data-page-size="50">
				<thead>
					<tr>
						
						<th data-hide="phone">批量</th>
						<th data-hide="phone">#</th>
						<th data-hide="phone">单号</th>
						<th data-hide="phone">变更前节点</th>
						 <th data-hide="phone">变更后节点</th>
						 <th data-hide="phone">状态</th>
						
					</tr>
				</thead>
				<tbody>
				<volist name="list" id="list">
				<tr>
					
					<td class="text-center">
						
						<center>
						<label class="option block mn">
						  <input type="checkbox" id="batch" name="batch" value="{$list.id}">
						
						</label>
						</center>
						
													
														
														
													  </td>
					<td>{$i}</td>
					
					 <td>{$list.order_id}</td> 
					 <td>
					 <if condition="$list.begin_status_name eq ''"> 
					 无信息
					
					 <else /> 
					  {$list.begin_status_name}
					 
					 </if>
					
					 
					 </td> 
					 <td>{$list.now_status_name}</td> 
					
					
				
					<td>
					
					
					
					<if condition="$list.is_change eq 2"> 
					<span style="color:red;"><b>不可变更</b></span>
					<elseif condition="$list.is_change eq 1"/>
					<span style="color:green;"><b>可变更</b></span>
					
					<else /> 
					
					
					</if>
					</td>
				
					
					
					 
				</tr>
				</volist>
				
				<script>
				
				function AJAXRo(id){  
						if(confirm('是否确认')){
							$.ajax({
								type:'POST',
								url:"__APP__/BestMall/Express/Order/OKedit.html",
								data:{
									"id": id,
								},
								success:function(data){								
									if (data == 1) {
									alert('成功');
									window.location.reload();
									}else{
										alert(data);
									}
								},
								error:function(){
									alert('未知错误');
								}
							
							});	 
						}
					} 
					
				function AJAXRestore(id){  
						if(confirm('是否确认删除')){
							$.ajax({
								type:'POST',
								url:"__APP__/BestMall/Express/Order/Delete.html",
								data:{
									"id": id,
								},
								success:function(data){								
									if (data == 1) {
									alert('成功');
									window.location.reload();
									}else{
										alert(data);
									}
								},
								error:function(){
									alert('未知错误');
								}
							
							});	 
						}
					} 
													
					function AJAXOptimize(table){
							$.ajax({
								type:'POST',
								url:"__APP__/XYZR/Database/MySQL/Optimize.html",
								data:{
									"tables": table,
								},
								success:function(data){								
									if (data == 1) {
									alert('优化成功');
									window.location.reload();
									}else{
										alert(data);
									}
								},
								error:function(){
									alert('未知错误');
								}
							
							});	 
						
					} 
					function AJAXRepair(table){  
							$.ajax({
								type:'POST',
								url:"__APP__/XYZR/Database/MySQL/Repair.html",
								data:{
									"tables": table,
								},
								success:function(data){								
									if (data == 1) {
									alert('修复成功');
									window.location.reload();
									}else{
										alert(data);
									}
								},
								error:function(){
									alert('未知错误');
								}
							
							});	 
					} 
				</script>
			</tbody>
		
			 <tfoot class="footer-menu">
				<tr>
				  <td colspan="12">
					<nav class="text-right">
					  <ul class="pagination hide-if-no-paging"></ul>
					</nav>
				  </td>
				</tr>
			  </tfoot>

			</table>
            </div>
          </div>
		      
      </div>

	

   

</block>
<block name="Script">
	
  <!-- FooTable Plugin -->
  <script src="__ABSOLUTEADMIN__/vendor/plugins/footable/js/footable.all.min.js"></script>
   <!-- FooTable Addon -->
  <script src="__ABSOLUTEADMIN__/vendor/plugins/footable/js/footable.filter.min.js"></script>

 <script type="text/javascript">
 
	
		function unSelect(){
				
		  $("input[id='batch']").each(function(){
		   $(this).prop("checked",false);
		  });  
		  
	
		}
		
		function selectAll(){
				
		 $("input[id='batch']").each(function(){
		   $(this).prop("checked",true);
		  });  
		  
		}
		
		function reverse(){
				
		 $("input[id='batch']").each(function(){
			$(this).prop("checked",!this.checked);   
		  
			})
		}
		
			
				function status(){
				
				
						 var id=$('input[id="batch"]:checked').map(function(){return this.value}).get().join();
						
						layer.confirm('你确定要这样做么？', {
						  btn: ['确定','取消'] //按钮
						}, function(){
						  
						  $.ajax({
								type:'POST',
								url:"__APP__/Mall/OrderNode/ChangeInfo.html",
								data:{
									
									"id": id,
									//"status": status,
									
								},
								success:function(data){			
										var info = eval(data)
										if (info.errcode == 0) {
										
											layer.msg(info.errmsg);
											setTimeout(window.location.reload(),3000);
											
										}else{
											layer.msg(info.errmsg);
										}
								},
								error:function(){
									layer.msg('系统繁忙,请稍候重试！');
								}
							
							});	 
						  
						}, function(){
						  
						  
						});

					
				
				}
				
			
		
				function deletestatus(status){
				
				
						 var id=$('input[id="batch"]:checked').map(function(){return this.value}).get().join();
						
						layer.confirm('你确定要这样做么？', {
						  btn: ['确定','取消'] //按钮
						}, function(){
						  
						  $.ajax({
								type:'POST',
								url:"__APP__/Mall/OrderNode/Delete.html",
								data:{
									
									"id": id,
									"status": status,
									
								},
								success:function(data){			
										var info = eval(data)
										if (info.errcode == 0) {
										
											layer.msg(info.errmsg);
											setTimeout(window.location.reload(),3000);
											
										}else{
											layer.msg(info.errmsg);
										}
								},
								error:function(){
									layer.msg('系统繁忙,请稍候重试！');
								}
							
							});	 
						  
						}, function(){
						  
						  
						});

					
				
				}
				
				
					$("#partner_id").change(function(){
						  	var partner_id = $("#partner_id").val();
							
							
							var url = '__APP__/Mall/Order/Manage.html';
							url = url+'?partner_id='+partner_id;
						
							 self.location=url;
							
						
						
					});
					
					
						$("#status").change(function(){
						  	var status = $("#status").val();
							
							
							var url = '__APP__/Mall/Order/Manage.html';
							url = url+'?status='+status;
						
							 self.location=url;
							
						
						
					});
					
					$("#pay_type").change(function(){
						  	var pay_type = $("#pay_type").val();
							
							
							var url = '__APP__/Mall/Order/Manage.html';
							url = url+'?pay_type='+pay_type;
						
							 self.location=url;
							
						
						
					});
					
					$("#express_type").change(function(){
						  	var express_type = $("#express_type").val();
							
							
							var url = '__APP__/Mall/Order/Manage.html';
							url = url+'?express_type='+express_type;
						
							 self.location=url;
							
						
						
					});
						
					
  jQuery(document).ready(function() {

 

    // Init FooTable Examples
    $('.footable').footable();


  });
  </script>
</block>